import { RouteRecordRaw } from 'vue-router'
import Layout from '@/layout/index.vue'
import ErrorPage from '@/views/error/404.vue'

// 基础路由
export const RootRoute: RouteRecordRaw = {
  path: '/',
  name: 'Root',
  redirect: '/dashboard/index',
  meta: {
    title: 'Root',
    hiddenMenu: true
  }
}

export const LoginRoute: RouteRecordRaw = {
  path: '/login',
  name: 'Login',
  component: () => import('@/views/Login.vue'),
  meta: {
    title: '登录',
    hiddenMenu: true
  }
}

// 404页面
export const ErrorPageRoute: RouteRecordRaw = {
  path: '/:path(.*)*',
  name: 'ErrorPage',
  component: Layout,
  meta: {
    title: 'ErrorPage',
    hideBreadcrumb: true
  },
  children: [
    {
      path: '/:path(.*)*',
      name: 'ErrorPageSon',
      component: ErrorPage,
      meta: {
        title: 'ErrorPage',
        hideBreadcrumb: true
      }
    }
  ]
}

// 重定向页面
export const RedirectRoute: RouteRecordRaw = {
  path: '/redirect',
  name: 'RedirectGlobl',
  component: Layout,
  meta: {
    title: 'RedirectGlobl',
    hiddenMenu: true
  },
  children: [
    {
      path: '/redirect/:path(.*)',
      name: 'RedirectGloblChild',
      component: () => import('@/views/redirect/index.vue'),
      meta: {
        title: 'RedirectChild',
        hiddenMenu: true
      }
    }
  ]
}
